package com.xkh.common.util;

import org.junit.Test;

import java.util.Arrays;
import java.util.List;
import java.util.Random;

public class ImgDivision {

    @Test
    public void tesst(){
        String img = "";
        String[] arr = img.split(",");
        StringBuilder sb = new StringBuilder();
        for (String s : arr) {
            sb.append("\"").append(s).append("\"").append(",");
        }
        System.out.println(sb.substring(0,sb.length()-1));
    }

    @Test
    public void test1(){
        String b = "烟草小毛驴\n" +
                "小闹心\n" +
                "葡小萄\n" +
                "嚼着炫迈做着梦\n" +
                "哦嗨哟\n" +
                "宅小猫\n" +
                "记忆的痕迹\n" +
                "折花载酒少年事\n" +
                "举杯邀酒敬孤独\n" +
                "且听风铃\n" +
                "烛光里的愿\n" +
                "梦想三旬\n" +
                "触摸阳光\n" +
                "偷得浮生\n" +
                "被风吹过灼思\n" +
                "不想翻身的咸鱼\n" +
                "深巷的猫\n" +
                "勇敢的小萝卜\n" +
                "烟雨彷徨\n" +
                "青烟尽\n" +
                "夜微凉\n" +
                "小情绪\n" +
                "勿念初心\n" +
                "时间的尘土\n" +
                "临风不自傲\n" +
                "沧笙踏歌\n" +
                "焰火灿烂时\n" +
                "甲乙丙丁\n" +
                "木槿昔年\n" +
                "樱花雨\n" +
                "简迷离\n" +
                "梦在深巷\n" +
                "彼岸花\n" +
                "讲给风听\n" +
                "笔墨书香\n" +
                "别来无恙\n" +
                "野尽风尘\n" +
                "咫尺天涯间\n" +
                "久日与至\n" +
                "造梦先生\n" +
                "南鸢离梦\n" +
                "孤城凉梦\n" +
                "画眉如黛\n" +
                "星星璀璨\n" +
                "此城无心忘少年\n" +
                "忽而令夏\n" +
                "华何不离伤\n" +
                "流年絮语\n" +
                "完美人生\n" +
                "迟夏饮冰\n" +
                "且笑天下江山如画\n" +
                "微凉的夏日\n" +
                "故人何以\n" +
                "格式化空白\n" +
                "梦伴\n" +
                "我的南方\n" +
                "孤帆去悠悠\n" +
                "风里有诗句\n" +
                "酒巷清风\n" +
                "余心\n" +
                "简白\n" +
                "桃花下浅酌\n" +
                "恒久\n" +
                "旅人\n" +
                "孤木\n" +
                "诗与彼方\n" +
                "若南";
        String[] arr  = b.split("\n");
        StringBuilder sb = new StringBuilder();
        for (String s : arr) {
            sb.append("\"").append(s).append("\"").append(",");
        }
        System.out.println(sb.substring(0,sb.length()-1));
    }

    @Test
    public void test3(){
        String a = "https://bjsocial.oss-cn-shenzhen.aliyuncs.com/25001bb9af73403bbbce0ee9a251d8f6.jpg,https://bjsocial.oss-cn-shenzhen.aliyuncs.com/02b12f776f1542588fc23e80b51561c3.jpg";
        String[] arr  = a.split(",");
        Random random = new Random();
        String head = arr[random.nextInt(  arr.length-1)];
        System.out.println(head);
    }
}
